import React from 'react'
import {
    Form,
    Button,
    Input,
} from 'antd'
import FooterToolbar from 'components/FooterToolbar';

const FormItem = Form.Item
const {TextArea} = Input;

const addRemarkForm = ({
    doSettlement4Payable,
    form: {
        getFieldDecorator,
        validateFieldsAndScroll
    }
}) => {
    const handleSubmit = (e) => {
        e.preventDefault();
        validateFieldsAndScroll((err, values) => {
            if (!err) {
                doSettlement4Payable(values);
            }
        });
    }

    return (
        <Form layout="horizontal" onSubmit={handleSubmit}>
            <FormItem>
                {getFieldDecorator('remark', {
                    rules: [
                        {
                            required: true,
                            message: '请输入结算备注'
                        }
                    ]
                })(<TextArea
                    style={{
                    minHeight: 32
                }}
                    placeholder="请输入结算备注"
                    rows={4}/>)}
            </FormItem>
            <FooterToolbar style={{
                width: '100%'
            }}>
                <Button type="primary" htmlType="submit">
                    提交
                </Button>
            </FooterToolbar>
        </Form>
    )
}

export default Form.create()(addRemarkForm);
